/**
 * author wen
 * &copy; CUNYU GROUP
 * email wjd_13@hotmail.com
 */
package com.cunyu.action;

import cn.tom.kit.StringUtil;
import com.cunyu.service.CityService;
import com.cunyu.service.CountService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 统计接口
 * @author win
 * 2019/05/14-16:16
 */
@Controller
public class CountController extends BaseController{

    @Resource
    CityService cityService ;

    @Resource
    CountService countService ;

    @RequestMapping("/count/cityBase")
    public String cityBaseNum(Model model,String pcode){
        // 默认江苏省
        int v = 320000 ;
        if(StringUtil.hasLength(pcode)){
            v = Integer.valueOf(pcode) ;
        }
        List<Map<String, Object>> mapList = cityService.provinceList();
        List<Map<String, Object>> respData = countService.cityBaseCoustorNumbers(v);

        model.addAttribute("respData",respData) ;
        model.addAttribute("province",mapList) ;
        model.addAttribute("pcode",v) ;
        return "count/cityBase" ;
    }

}
